/**
 *
 * 版权所有 © cybersky.com
 *
 */
package cn.cybertron.primus.report.query;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 报表数据查询器抽象类
 * @author ch
 *
 */
public abstract class AbstractReportQuery implements ReportQuery {

	private static final long serialVersionUID = -4111955917284783092L;

	/**
	 * 报表数据列表标题，key为字段名，value为显示在报表中的列标题，即字段别名
	 */
	protected Map<String, String> columnTitles = new HashMap<String, String>();
	
	/**
	 * 隐藏的列，即不在数据列表中显示的列
	 */
	protected List<String> hiddenColumns = new ArrayList<String>();

	/**
	 * 扩展属性
	 */
	protected Map<String, Object> extParams;
	
	/**
	 * 运行时条件扩展，该字段用来存放报表运行时条件组装的sql语句，
	 * 该sql语句在最终获取数据时与实际查询sql进行拼接
	 */
	protected List<String> rtSql;

	@Override
	public boolean isRTConditionSupport() {

		return false;
	}

	@Override
	public Map<String, String> getColumnTitles() {
		return this.columnTitles;
	}

	@Override
	public void setColumnTitles(Map<String, String> columnTitles) {
		this.columnTitles = columnTitles;
	}

	@Override
	public List<String> getHiddenColumns() {
		return this.hiddenColumns;
	}

	@Override
	public void setHiddenColumns(List<String> hiddenColumns) {
		this.hiddenColumns = hiddenColumns;
	}

	@Override
	public Map<String, Object> getExtParams() {
		return this.extParams;
	}

	@Override
	public void addExtParam(String key, Object value) {
		if (this.extParams == null)
			this.extParams = new HashMap<String, Object>();
		this.extParams.put(key, value);
	}

	@Override
	public List<String> getRTSql() {
		return this.rtSql;
	}

	@Override
	public void setRTSql(List<String> rtSql) {
		this.rtSql = rtSql;
	}
	
}
